package chan2svc

import (
	"starsine.cn/appTpl/cmn/logs"
	"starsine.cn/appTpl/svccenter/registry/restful/ws-server/wsserver"
	"starsine.cn/appTpl/svccenter/registry/svcmng/iservice"
)

var ws2SvcMap *Ws2SvcMap = nil

func Start() {
	ws2SvcMap = CreateWs2SvcMap()

	logs.Infof("registry.wshandler start")
}

func AddC2SMap(c *wsserver.WsServer, s iservice.IService) {
	ws2SvcMap.AddService(c, s)
}

func DelC2SMap(s iservice.IService) {
	ws2SvcMap.DelService(s)
}

func DelWsServer(c *wsserver.WsServer) {
	ws2SvcMap.DelWsServer(c)
}

func GetSvcFromWsServer(c *wsserver.WsServer) (iservice.IService, bool) {
	return ws2SvcMap.GetService(c)
}
